From: Alexander Mikhaylenko Date: Sat, 12 Feb 2022 13:33:51 +0000 (+0500) Subject: background: Handle errors when loading wallpapers X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~530^2^2~41 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=348fcdaa774e98deb06da3b3ba439860d4637b32;p=gnome-shell.git background: Handle errors when loading wallpapers Since it happens while setting up the startup animation, we will get stuck inside that animation and block input if it fails. Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5062 Part-of: --- diff --git a/js/ui/background.js b/js/ui/background.js index 21359d0a8..0b53f3fd0 100644 --- a/js/ui/background.js +++ b/js/ui/background.js @@ -496,11 +496,17 @@ var Background = GObject.registerClass({ } async _loadFile(file) { - const info = await file.query_info_async( - Gio.FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, - Gio.FileQueryInfoFlags.NONE, - 0, - null); + let info; + try { + info = await file.query_info_async( + Gio.FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, + Gio.FileQueryInfoFlags.NONE, + 0, + null); + } catch (e) { + this._setLoaded(); + return; + } const contentType = info.get_content_type(); if (contentType === 'application/xml')